package gam.n1.achievement.n;

import gam.n1.achievement.iAchievement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.Supplier;

public class StringAchievement extends BaseAchievement<String>{

    public StringAchievement(@NotNull Supplier<String> initValue, @Nullable String name) {
        super(initValue, name);
    }

    @Override
    public void set(String s) {
        if (s.length() <= 15){
            this.$t = s;
        }
    }

    @Override
    public Class<String> t() {
        return String.class;
    }

    @Override
    public iAchievement<String> copy() {
        return new StringAchievement(valueF,name);
    }
}
